﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace qtAiGamesLibrary
{
    /// <summary>
    /// The base class for anything that should be renderable
    /// so that we can itterate through them and render them regardless
    /// of what they are
    /// </summary>
    public class Object2D
    {
        // Pulbic:
        /// <summary>
        /// Calls the render function.
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatch spriteBatch)
        {
            Render(spriteBatch);
        }

        /// <summary>
        /// Renders this object! Duh!   
        /// </summary>
        public void Render(SpriteBatch spriteBatch)
        {
           spriteBatch.Draw(_Texture, _Position, _Source, _Tint, _Rotation, _Origin, _Scale, _SpriteEffect, _LayerDepth);
        }
        

        // Private:
        private Texture2D _Texture;                         // Texture of this object
        private Vector2 _Position;                          // Position of this object (where it will be rendered)
        private Rectangle _Source;                          // Where in the texture, allows for offsets
        private Color _Tint;                                // The tint we should use on this object
        private float _Rotation;                            // Rotation in radians to rotate around _Origin
        private Vector2 _Origin;                            // This is the point that will be rotated about
        SpriteEffects _SpriteEffect = SpriteEffects.None;   // The effects to be used on this
        float _LayerDepth;                                  // The layer depth from 0.0 to 1.0f
        private Vector2 _Scale;
    }
}
